package practice;

import java.io.*;

public class Demo08oos {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        User user=new User("hezhengxin","甘肃","男",24);
        FileOutputStream fos=new FileOutputStream("何正新.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);

        oos.writeObject(user);

        System.out.println("实例化完成！");

        oos.close();
    }
}
